﻿@model Mestedur.ViewModels.UsersListViewModel

@{
    ViewBag.Title = "Работа с пользователями";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h3>Управление пользователями</h3>
@if (!String.IsNullOrEmpty(Model.Message)){
     <div class = "system_message">
        @Model.Message
     </div>
     }
<p>
    <!--@Html.ActionLink("Create New", "CreateNew")-->
</p>
<div class="text">
<table>
@foreach (var item in Model.Users) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.UserName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.EMail)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Online)
        </td>
        <td>
            <!--@Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |-->
            <!--@Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |-->
            <!--@Html.ActionLink("Удалить", "DeleteUser", new { id=item.UserName})-->
            <a href = "@("Administrator/DeleteUser" + "?userName=" + item.UserName)">
            Удалить</a>
        </td>
    </tr>
}
</table>
<div class="editorButton">
@using (Html.BeginForm("Import", "Administrator", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    <input type = "file" name = "file"/>
    <input type = "submit" value = "Импортировать"/>
}
 </div>
<br />
    @Html.ActionLink("Экспортировать", "Export")
    </div>